const express = require('express')
let app = express()
app.use(express.static('.'))
app.use(express.urlencoded({
    extended: false
}))
app.use(express.json())

app.get('/', (req, res) => {
    res.json('hi')
})

let data = {
    sno: '07200932',
    name: '',
    gender: 1,
    skill: [
        {
            name: 'HTML',
            count: 0
        },
        {
            name: 'CSS',
            count: 0
        },
        {
            name: 'JavaScript',
            count: 0
        },
        {
            name: 'miniprogram',
            count: 0
        }
    ],
    satisfaction:0,
    opinion:'',
    count:0
}
app.get('/sampledata',(req,res)=>{
    res.json(data)
})
app.post('/sampledata',(req,res)=>{
    console.log(req.body)
    req.body.num = 100
    res.json(req.body)
})
app.listen(9999)